﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class usercontrol_products_Searchadvantage : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnsearch_Click(object sender, EventArgs e)
    {
        string query = "";
        string tam = "";
        if (this.drbrand.SelectedIndex != 0)
        {
            tam = "Brand_Id= ";
            tam += this.drbrand.SelectedValue.ToString();
            query += tam;
        }
        if (this.drpricemin.SelectedItem.ToString() != "0")
        {
            if (query != "") tam = " and ";
            else tam = "";
            tam += " (Products_Price between " + drpricemin.SelectedItem.ToString() + " and " + this.drpricemax.SelectedItem.ToString() + " )";
            query += tam;
        }
        Response.Redirect("http://localhost:2011/didong/search/default.aspx?query=" + query);
    }
}
